package com.app.coffeephilosophy.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.app.coffeephilosophy.R;
import com.app.coffeephilosophy.adapter.MakeAdapter;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class CoffeeMakeActivity extends Activity {
	private ListView listview;
	private Button makeback;
	MakeAdapter makeadapter;
    private int type;
  
	 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN); // 设置全屏模式
		requestWindowFeature(Window.FEATURE_NO_TITLE); // 去除标题栏
		setContentView(R.layout.coffeemake_list);
	
		setData();
		makeback = (Button) this.findViewById(R.id.makeback);
		listview = (ListView) this.findViewById(R.id.make_list);
		listview.setAdapter(makeadapter);
		listview.setCacheColorHint(Color.TRANSPARENT);
		makeback.setOnClickListener(new OnClickListener(){

			 
			public void onClick(View v) {
	
				finish();
			}
						
		});
			
	}
   
	public void setData() {
		
		int[] imagesmake = new int[] { R.drawable.makeicon1,
				R.drawable.makeicon2, R.drawable.makeicon3,
				R.drawable.makeicon4 };
		String[] textmake = (String[]) this.getResources().getStringArray(
				R.array.textmake);

		Intent intent=getIntent();
		int imageId = intent.getIntExtra("id", R.drawable.lanshan_big);
		type = intent.getIntExtra("type", 0);
		switch (type) {		
		case 1:			
			makeadapter = new MakeAdapter(imagesmake, textmake[imageId],
					CoffeeMakeActivity.this);
			break;
		case 2:
			makeadapter = new MakeAdapter(imagesmake, textmake[imageId],
					CoffeeMakeActivity.this);
			break;
		case 3:
			makeadapter = new MakeAdapter(imagesmake, textmake[imageId],
					CoffeeMakeActivity.this);
			break;
		}
	}

}
